package com.UI
{
	import com.*;
	import com.Engine.*;
	import com.Packet.*;
	import com.UI.*;
	
	import flash.display.*;
	import flash.display.BitmapData;
	import flash.events.*;
	import flash.external.*;
	import flash.filters.*;
	import flash.geom.*;
	import flash.net.*;
	import flash.system.*;
	import flash.text.*;
	import flash.ui.*;
	import flash.utils.*;
	import flash.utils.ByteArray;
	import flash.utils.getQualifiedClassName;
	
	import org.aswing.*;
	import org.aswing.border.*;
	import org.aswing.border.EmptyBorder;
	import org.aswing.colorchooser.*;
	import org.aswing.dnd.*;
	import org.aswing.event.*;
	import org.aswing.ext.*;
	import org.aswing.geom.*;
	import org.aswing.graphics.*;
	import org.aswing.tree.AbstractLayoutCache;
	//import src.*;
	
	
	public class DraggingImageSkill implements DraggingImage
	{
		private var initiator:PanelSkill;
		
		public function DraggingImageSkill(dragInitiator : PanelSkill)
		{
			initiator = new PanelSkill();
			initiator.height = dragInitiator.height;
			initiator.width = dragInitiator.width;
			initiator.setLocationXY(0,0);
			initiator.panelImage.setBackgroundDecorator(new AssetBackground(Client.getSkillElement("img_skill_"+dragInitiator.icon_id) as DisplayObject));
		}
		
		public function getDisplay():DisplayObject
		{
			return initiator;
		}
		
		/**
		 * 表现拖动组件被目标组件接受时的图像。
		 */
		public function switchToAcceptImage() : void 
		{
			var filter:GlowFilter;
			filter = new GlowFilter(0x00ff00, 1, 2, 2, 10);
			initiator.filters = new Array(filter);
		}
		
		/**
		 * 表现拖动组件被目标组件不被接受时的图像。
		 */
		public function switchToRejectImage() : void 
		{
			var filter:GlowFilter;
			filter = new GlowFilter(0xff0000, 1, 2, 2, 10);
			initiator.filters = new Array(filter);
		}
		
	}
}